#include "TetradFactory.h"
#include "egg.h"
#include "waste.h"
#include "geese.h"
#include "chicken.h"
#include "basket.h"
#include "duck.h"
#include <time.h>
CTetradFactory::CTetradFactory()
{
	srand ( (unsigned int)time(NULL) );
}

CTetradFactory::~CTetradFactory()
{
}

CTetrad* CTetradFactory::CreateTetrad(CBlocksMatrix* pMatrix)
{

	CTetrad* pNewTetrad = NULL;

	int value = rand()%2;
	switch (value)
	{
	case 0:
		pNewTetrad = new egg(pMatrix);
		pNewTetrad->settortr=1;
		break;
	case 1:
		pNewTetrad = new waste(pMatrix);
		pNewTetrad->settortr=2;
		break;
	}

	return pNewTetrad;
}
CTetrad* CTetradFactory::taongana(CBlocksMatrix* pngan)
{
	CTetrad* ngan = NULL;
		ngan = new geese(pngan);
		ngan->settortr=0;
	return ngan;
}
CTetrad* CTetradFactory::taoga(CBlocksMatrix* pga)
{
	CTetrad* cga = NULL;
		cga = new chicken(pga);
		cga->settortr=0;
	return cga;
}
CTetrad* CTetradFactory::taovit(CBlocksMatrix* pvit)
{
	CTetrad* cvit = NULL;
		cvit = new duck(pvit);
		cvit->settortr=0;
	return cvit;
}

CTetrad* CTetradFactory::taoro(CBlocksMatrix* pro)
{
	CTetrad* cro = NULL;
		cro = new basket(pro);
		cro->settortr=0;
	return cro;
}